import service from "@/utils/request";

export function getUserCode() {
    return service({
        url: '/captchaImage',
        method: 'get'
    })
}

export function findById(id) {
    return service({
        url: '/user/findById?id=' + id,
        method: 'get'
    })
}

export function Login(data) {
    return service({
        url: '/user/login',
        method: 'post',
        params: data
    })
}

export function Register(data){
    return service({
        url: '/user/register',
        method: 'post',
        data: data
    })
}

export function updateUser(data) {
    return service({
        url: '/user/updateUser',
        method: 'post',
        params: data
    })
}

export function uploadAvatar(data) {
    return service({
        url: "user/upload",
        method: 'post',
        data: data,
    })
}
